﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Main : MonoBehaviour
{
    public static Main main;
    private void Awake()
    {
        if (main == null)
        {
            main = this;
        }
    }
    void Start()
    {
        this.gameObject.AddComponent<MessageHandler>();
        LuaManager.AddLuaEnv();
        StartLua();
    }
    void StartLua()
    {
        AssetBundleManager.LoadAssetBundle("start");
        LuaManager.luaEnv.DoString("require 'start.start'", "LuaManager");
    }
    private void OnDestroy()
    {
        LuaManager.DestoryLuaEnv();
        AssetBundleManager.DestoryAssets();
    }
}
